Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.hw
Class ModuleWire

    java.lang.Object
      rdlc.rdl.Field_Named
          rdlc.hw.ModuleWire

All Implemented Interfaces:
  Expression, Field

    public class ModuleWire

extends Field_Named

Abstraction of bus or wire. Has a width and a type (inout, wire, reg, etc) as well as a name.

Version:
  $Revision: 1.10 $
Author:
  Greg Gibeling

Nested Class Summary
`static class` | `ModuleWire.Type` Iterator of all the possible wire types.

Nested classes/interfaces inherited from interface rdlc.rdl.Expression
`Expression.Phase`

Field Summary
`protected java.util.Hashtable<java.lang.String,java.lang.String>` | `attributes` A mapping from synthesis attribute names to values for this wire.
`protected ModuleWire.Type` | `type` The declared HDL type of this wire.
`protected Expression` | `width` The bitwidth of this wire.

Fields inherited from class rdlc.rdl.Field_Named
`iName, instance, namespace, rawDynamicID`

Constructor Summary
`ModuleWire(ModuleWire _wire, Instance _instance, java.lang.String namePrefix, boolean forceType, ModuleWire.Type _type, boolean copyAttributes)` Copy constructor.
`ModuleWire(java.lang.String _name, Instance _instance, Expression _width, ModuleWire.Type _type, java.lang.String _attribute)` Create a wire with the given name and type.
`ModuleWire(java.lang.String _name, Instance _instance, int _width, ModuleWire.Type _type, java.lang.String _attribute)` Create a simple bus with the given width, name, type and attributes.
`ModuleWire(java.lang.String _name, Instance _instance, ModuleWire.Type _type, java.lang.String _attribute)` Create a wire with the given name, type and attributes.

Method Summary
`Field` | `copy(java.lang.String _name, Instance _instance)` Create a copy of this field in the given instance.
`java.util.Hashtable<java.lang.String,java.lang.String>` | `getAttributes()` Simple accessor.
`ModuleWire.Type` | `getType()` Simple accessor.
`Expression` | `getWidth()` Simple accessor.
`boolean` | `isPort()` Check if this is a wire which can be used as a port.
`static ModuleWire.Type` | `lookupWireType(java.lang.String typeName)` Simple method to lookup the type of a wire based on a string.
`protected void` | `setAttributes(java.lang.String _attribute)` Set the attributes hash table of this wire based on the given attribute string.
`java.lang.String` | `toString()` Simple accessor.

Methods inherited from class rdlc.rdl.Field_Named
`getIdentifier, getRawDynamicID, getRequirements, resolve, setInstance, setNamespace, setRawDynamicID, typeMatch`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### width

    protected Expression width

  The bitwidth of this wire. Note that this is an expression allowing bitwidths to be computed at HDL compile time.

### type

    protected ModuleWire.Type type

  The declared HDL type of this wire.

### attributes

    protected java.util.Hashtable<java.lang.String,java.lang.String> attributes

  A mapping from synthesis attribute names to values for this wire.

Constructor Detail

### ModuleWire

    public ModuleWire(java.lang.String _name,
                      Instance _instance,
                      int _width,
                      ModuleWire.Type _type,
                      java.lang.String _attribute)

  Create a simple bus with the given width, name, type and attributes.

  Parameters:
    `_width` - The width of this bus.
    `_instance` - The module or wire group to add this bus to.
    `_name` - The name of this bus.
    `_type` - The type of this bus.
    `_attribute` - A string listing the synthesis attributes and their values.

### ModuleWire

    public ModuleWire(java.lang.String _name,
                      Instance _instance,
                      ModuleWire.Type _type,
                      java.lang.String _attribute)

  Create a wire with the given name, type and attributes. This assumes a bitwidth of 1.

  Parameters:
    `_name` - The name of this wire.
    `_instance` - The module or wire group to add this bus to.
    `_type` - The type of this wire.
    `_attribute` - A string listing the synthesis attributes and their values.

### ModuleWire

    public ModuleWire(java.lang.String _name,
                      Instance _instance,
                      Expression _width,
                      ModuleWire.Type _type,
                      java.lang.String _attribute)

  Create a wire with the given name and type. Use the given expression for the width. This allows parameterized and computed bus widths.

  Parameters:
    `_width` - The width of this bus, as an expression.
    `_instance` - The module or wire group to add this bus to.
    `_name` - The name of this bus.
    `_type` - The type of this bus.
    `_attribute` - A string listing the synthesis attributes and their values.

### ModuleWire

    public ModuleWire(ModuleWire _wire,
                      Instance _instance,
                      java.lang.String namePrefix,
                      boolean forceType,
                      ModuleWire.Type _type,
                      boolean copyAttributes)

  Copy constructor. This will copy the given wire into the given instance while optionally adding a name prefix, changing the wire type and stripping the synthesis attributes.

  Parameters:
    `_wire` - The wire to copy.
    `_instance` - The instance to copy into.
    `namePrefix` - An optional name prefix, may be `null`.
    `forceType` - Should the type of this wire be forced to the given value?
    `_type` - The type to force this wire to (instead of copying the type).
    `copyAttributes` - Should the attributes be copied (as opposed to dropped)?

Method Detail

### copy

    public Field copy(java.lang.String _name,
                      Instance _instance)

  Description copied from interface: `Field`
  Create a copy of this field in the given instance. This is highly useful during dynamic hierarchy copying and during back end generation.

  Parameters:
    `_name` - The new name to use.
    `_instance` - The instance the copy should be a member of.
  See Also:
    `Field.copy(String, Instance)`

### toString

    public java.lang.String toString()

  Simple accessor.

  Overrides:
    `toString` in class `Field_Named`
  Returns:
    A human readable representation of this wire for debugging.

### getWidth

    public Expression getWidth()

  Simple accessor.

  Returns:
    The expression which computes width of this wire.

### getType

    public ModuleWire.Type getType()

  Simple accessor.

  Returns:
    The type of this wire.

### isPort

    public boolean isPort()

  Check if this is a wire which can be used as a port. Wires and regs cannot be used as module ports, but inputs, outputs and inouts can.

  Returns:
    `true` if this wire is of a type which can appear as a port.

### setAttributes

    protected void setAttributes(java.lang.String _attribute)

  Set the attributes hash table of this wire based on the given attribute string. Attributes should be off the form "key = value" where value may itself be a quoted string. Multiple attributes should be separated by commas.

  Parameters:
    `_attribute` - The attribute string to lex and parse.

### getAttributes

    public java.util.Hashtable<java.lang.String,java.lang.String> getAttributes()

  Simple accessor.

  Returns:
    A hashtable mapping attribute names to their values.

### lookupWireType

    public static ModuleWire.Type lookupWireType(java.lang.String typeName)

  Simple method to lookup the type of a wire based on a string. Essentially turns "output" into TYPE_OUTPUT, etc. This is used during library loading.

  Parameters:
    `typeName` - The type name to find.
  Returns:
    The type value for that name, `-1` on failure.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD